﻿using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;

namespace XLugia.Lib.XDataBase.Base.Lib
{
    public class DatabaseEntities : DbContext
    {
        /// <summary>
        /// 数据库实体
        /// </summary>
        /// <param name="databaseConnector">数据库连接器</param>
        public DatabaseEntities(DatabaseConnector databaseConnector)
            : base(databaseConnector.metadata)
        {
            ((System.Data.Entity.Infrastructure.IObjectContextAdapter)this).ObjectContext.CommandTimeout = databaseConnector.commandTimeout;
        }
    }
}
